package com.biostime.dingdingbox.modules.db.service;


import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 工具包
 * @author chenweicheng
 * @version 2016-03-22
 */
@Service
@Transactional
public class UtilService {
	
	
	/**
	 * 产生流水号
	 * @author chenweicheng
	 * @version 2016-03-22
	 */
	public String generateCode(String head){
		
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmSS");
		String code = (head+sdf.format(new Date()) +(new Random().nextInt(900)+100) ); 		
		
		return code;
	}
}
